import request from '@/utils/request'

// 查询任务详情列表
export function listView(query) {
  return request({
    url: '/task/view/list',
    method: 'get',
    params: query
  })
}

// 查询任务详情详细
export function getView(id) {
  return request({
    url: '/task/view/' + id,
    method: 'get'
  })
}

// 新增任务详情
export function addView(data) {
  return request({
    url: '/task/view',
    method: 'post',
    data: data
  })
}

// 修改任务详情
export function updateView(data) {
  return request({
    url: '/task/view',
    method: 'put',
    data: data
  })
}

// 删除任务详情
export function delView(id) {
  return request({
    url: '/task/view/' + id,
    method: 'delete'
  })
}

// 导出任务详情
export function exportView(query) {
  return request({
    url: '/task/view/export',
    method: 'get',
    params: query
  })
}

// 领取任务
export function acceptTaskAction(taskViewId) {
  return request({
    url: '/task/view/acceptTaskAction',
    method: 'put',
    data: {taskViewId:taskViewId}
  })
}


// 分配任务
export function allotTaskAction(taskViewId,userId) {
  return request({
    url: '/task/view/allotTaskAction',
    method: 'put',
    data: {
      taskViewId:taskViewId,
      userId:userId
    }
  })
}
